The phrase "to earn a discount" means that you can get a lower price on something by doing something specific or meeting certain requirements.